<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>

<script src="${ctx}/includes/jquery.js" type="text/javascript"></script>
<script src="${ctx}/includes/jquery.form.js" type="text/javascript"></script>
<script src="${ctx}/includes/jquery.validate.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="${ctx}/style/form_table.css">
<script>
$(function(){
	$("#edit_ccsqProcess_form").validate({
		errorPlacement: function(error, element){
            $(element).next('.field_notice').hide();
            $(element).after(error);
       },
	   success: function(label){   
	       label.addClass('right').text('OK!');
	   },
	   rules:   
	   {
	    	zt : {required : true}
	   },   
	   message:{
	    	zt : {required : '请选择办理结果'}
	   }
	});  
});
</script>
<s:form id="edit_ccsqProcess_form" name="edit_zdxzdcProcess_form" method="post" action="pubCcsq/sh.do" onsubmit="return false;">
	<s:token/>
	<s:hidden id="id" name="id" />
	<table class="form-table">
		<tr>
			<th width="150">员工编号：</th>
			<td>${ygbh}</td>
		</tr>
		<tr>
			<th width="150">员工姓名：</th>
			<td>${ygxm}</td>
		</tr>
		<tr>
			<th width="150">部门：</th>
			<td>${bm}</td>
		</tr>
		<tr>
			<th width="150">出差类型：</th>
			<td>${cclx}</td>
		</tr>
		<tr>
			<th width="150">职业发展层级：</th>
			<td>${zyfzcj}</td>
		</tr>
		<tr>
			<th width="150">出差理由：</th>
			<td>${ccly}</td>
		</tr>
		<tr>
			<th width="150"><span class="note_red">*</span>办理结果：</th>
			<td>
			<select name="zt" id="hanldresult">
				<option value="">请选择</option>
				<option value="2">同意</option>
				<option value="3">退回</option>
			</select>
			</td>
		</tr>
		<tr>
			<th width="150">审核意见：</th>
			<td>
			<textarea rows="4" name="shyj" id="wcqk" style="width: 500px;"></textarea>
			</td>
		</tr>
	</table>
	<div class="win-btn-panel" style="text-align: center;margin-top: 5px;">
		<input class="btn-short" type="button" name="subbtn" id="spwc" value="提交" title="点击审批" onClick="shwc();"/>
	</div>
</s:form>
<script type="text/javascript">

/*审批完成*/
function shwc(){
	var v = $("#edit_ccsqProcess_form").valid();
	if(!v)return false;
	
	//$('#edit_ccsqProcess_form').attr("action","${ctx}/zdxzdc/shfp.do");
	$('#edit_ccsqProcess_form').ajaxSubmit(resultHandler);
    return false;
    
}

function resultHandler(responseXML){
	var result = responseXML.getElementsByTagName("result")[0].firstChild.nodeValue;
	var message = responseXML.getElementsByTagName("error-message")[0].firstChild.nodeValue;
	var errorType = responseXML.getElementsByTagName("error-type")[0].firstChild.nodeValue;
	if(!eval(result)&&(errorType!=2)){
		alert(message);
	}
	else{
		var curDate = new Date(); 
		alert(message);
		parent.location.replace("${ctx}/pubCcsq/myTask.do?opt=ccsq&timsStamp=" + curDate.getTime());
	}
}
function downloadFile(A){
	window.location.href='${ctx}/filedownload.do?fileAsName='+A+'&timsStamp=' + new date().getTime();
}


</script>
